// ArxLoader.cpp : Initialization functions
#include "StdAfx.h"
#include "StdArx.h"
#include "resource.h"
//#include <afxdllx.h>
#include "AddCADFrameMenu.h"
#include "ComFuns.h"


//HINSTANCE _hdllInstance =NULL ;



////////////////////////////////////////////////////////////////////////////
//
// Define the sole extension module object.
//AC_IMPLEMENT_EXTENSION_MODULE(ArxLoaderDLL);

// Now you can use the CAcModuleResourceOverride class in
// your application to switch to the correct resource instance.
// Please see the ObjectARX Documentation for more details

/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
 //       _hdllInstance = hInstance;
		// Extension DLL one time initialization
//		ArxLoaderDLL.AttachInstance(hInstance);
		InitAcUiDLL();
	} else if (dwReason == DLL_PROCESS_DETACH) {
		// Terminate the library before destructors are called
//		ArxLoaderDLL.DetachInstance();
	}
	
	TCHAR strPath[_MAX_PATH];
	::GetModuleFileName(hInstance, strPath, _MAX_PATH);
	TCHAR szDrv[_MAX_DRIVE], szDir[_MAX_PATH], szFile[_MAX_FNAME], szExt[_MAX_EXT];
	_tsplitpath(strPath, szDrv, szDir, szFile, szExt);
	
	TCHAR pzPath[MAX_PATH];
	_tmakepath(pzPath,szDrv,szDir,NULL,NULL);
	g_sDllPath = pzPath;

	return TRUE;    // ok
}

